home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Prog / M / MacOberon.cpt / MacOberonDoc.sit / OG1.Text (.txt) < prev    next >
Encoding:
Oberon Text  |  1990-11-07  |  25.6 KB  |  319 lines  |  [.Ob./.Ob*]

  1. Syntax16.Scn.Fnt
  2. Syntax10.Scn.Fnt
  3. Syntax14.Scn.Fnt
  4. Syntax12.Scn.Fnt
  5. Syntax12b.Scn.Fnt
  6. Syntax12i.Scn.Fnt
  7. User's Guide
  8. Commands and Tools
  9. Among the classes of possible objects to be handled by a computer system the class of texts plays a key role.
  10. Not only are input and output data frequently represented as text, but also objects and commands are often
  11. identified by their name. Text is, therefore, a predefined class of objects in Oberon.
  12. This manifests itself immediately after system startup, when, besides of the log-viewer, a so-called tool
  13. viewer is automatically opened on the screen. It contains a list of command names, some of them followed
  14. by parameters. Command names in Oberon are of the form M.P, where M designates a module (package)
  15. and P a procedure (operation) that is provided by the module. A user activates a command simply by
  16. pointing to its name with the mouse and clicking the middle mouse key. For example, activating the
  17. command Edit.Open will result in a new viewer showing some default text.
  18. More often than not, the execution of a command is parameterized. For example, the opening of another
  19. tool needs the specification of its name, as in System.Open Edit.Tool or in System.Open Net.Tool. Although
  20. typical, this is not by far the most general case of a parameter specification. Some commands accept an
  21. entire list of names following the command name and execute repeatedly for each member of the list. In
  22. principle, a text obeying an arbitrary syntax (understood by the command) could be passed over equally
  23. well. Commands may even expect as parameters objects of any kind currently existing in the system such as
  24. viewers, text selections, caret, and a global star-shaped pointer. Some commands even allow different ways
  25. of paramewter specification. For example, if System.Open or Edit.Open is called with a "^"-symbol instead of
  26. a file name following the command name, then the file name is taken from the most recent selection. In
  27. general, a "^"-symbol following a command name always refers to the current selection.
  28. It is noteworthy that tools are ordinary texts distinguishing themselves from more usual texts only by their
  29. structure and contents. In particular, tools are amenable to editing operations. Looking at this differently,
  30. we recognize that commands like Edit.Open Explanations.Text may well slip into a prose text and be activated
  31. directly in situ. Obviously, no limits are set to fantasy exploiting this universal scheme of command
  32. interpretation.
  33. One rather moderate application of the universal scheme discussed above is the construction of
  34. interconnected texts. As a matter of fact, the set of standard tools is structured as a tree with the System.Tool
  35. as ancestor and the tools listed in the System.Tool as its descendants. We recall that the hierarchical tool
  36. system may easily be customized on the fly by adjusting command lists (including parameters) to personal
  37. requirements, reconfiguring the tool hierarchy, installing new tools, or even providing on-line
  38. documentation.
  39. We now discuss editing operations. Recall first that most commands are interpreted individually by viewers.
  40. There are, however, a few more universal operations, which are handled directly by the central system. For
  41. example, when you type escape, all marks on the display are removed, including caret and text selections. Or,
  42. when you type ctrl shift del the system immediately terminates the execution of the current command and
  43. opens a trap-viewer displaying the state of the interrupted process. Notice that we have just identified you
  44. as the reader of this guide with a user of the system. In order to simplify phrasing, we shall henceforth
  45. occasionally do so tacitly.
  46. Next we turn to viewers and display-specific operations. You can put your primary display screen into any
  47. one of three different modes by hitting one of the function keys PF1, PF2, and PF3. PF1 specifies white script
  48. on a black background, PF2 turns the display off, and PF3 specifies black script on a white background.
  49. Oberon uses a tiling viewer system. The display is divided into vertical  tracks, and each track is further
  50. subdivided into viewers. In reality, the structure of viewers is three-dimensional. A new track may in fact
  51. overlay one or, more generally, an integral number of existing tracks. The original configuration will be
  52. reestablished when the overlaying track is later removed.
  53. Although the global screen layout can be changed, we relate our current explanations to the standard layout
  54. showing two tracks, a larger user track on the left and a narrower system track on the right. In principle,
  55. viewers are allocated automatically by the respective commands using a little heuristics. For example, tool
  56. viewers are opened in the system track, and document viewers in the user track. However, you can override
  57. any automatic allocation by first placing the pointer at the location where you desire the top of the new
  58. viewer to be placed. The pointer is a star-shaped marker, and it is placed by moving the mouse to the
  59. desired location and then hitting the SETUP key. In order to change the size of an existing viewer, simply
  60. point to its title-bar, press the left mouse key, and move the mouse up or down accordingly. You can also
  61. conveniently move a viewer to any different place on the display screen by starting exactly as just explained,
  62. then interclicking the middle mouse-key, dragging the mouse to the new location, and releasing all keys
  63. there.
  64. Interclicking means clicking (pressing and releasing) a secondary mouse button at an arbitrary time while a
  65. primary mouse key is being held down. In general, interclicking is an efficient and versatile tool to multiply
  66. the expressiveness of the mouse. In Oberon, interclicking is applied according to a systematic underlying
  67. pattern. You will find out more about this pattern in the following chapters. Perhaps the easiest and most
  68. important rule says that the current command is nullified, if all remaining mouse-keys have been
  69. interclicked (not necessarily simultaneously) during the action.
  70. By convention, most viewers (so-called menu-viewers) show a header consisting of a title and a list of
  71. selected commands (menu). These commands automatically refer to their own viewer. In the case of
  72. ordinary text viewers, commands are included from the System tool-package and the Edit tool-package.
  73. System.Close removes the viewer, Edit.Copy opens a new viewer displaying  the same instance of text,
  74. Edit.Grow lets the viewer grow to the size of a full track or of the whole display, Edit.Locate locates a text
  75. position, and Edit.Store stores the text on file. We shall explain these commands in greater detail in the
  76. following sections on tools.
  77. First, we fix some terminology and general conventions. We shall call marked an object or a location if it is
  78. visibly or invisibly marked by the earlier introduced star-shaped pointer. Visibility of the pointer is irrelevant
  79. in most cases. As an exception we mention the explicit allocation of a viewer, which requests the pointer to
  80. be visible. Note that an explicitly allocated viewer is automatically marked. Also note that the pointer is
  81. initially invisible and placed in the lower left corner of the display.
  82. By convention, the title of a viewer is normally either the name of the displayed object or the name of the
  83. command that opened this viewer. Further, if a list of names is passed to a command as a parameter, it
  84. must be terminated by a symbol other than a name, for example by the character "~". By another
  85. convention, the upper right corner of the display is reserved for the log viewer reporting on the progress and
  86. result in the execution of a command. Finally, there are several default extensions of file names. Among them
  87. are Text, Graph and Pict for file copies of texts, graphics, and bitmap pictures respectively, and Scn.Fnt for
  88. screen font files.
  89. In the following sections we shall use the terms parameter and parameter list in the restricted sense of "item
  90. following the command name" and "list of items following the command name" respectively.
  91. The Edit Tool Package
  92. We have stated earlier that extensibility was a key objective in the design of Oberon. It was therefore
  93. enticing to realize also system-oriented commands as extensions of the system-core on a highest possible
  94. level in the modular hierarchy, thereby achieving maximal flexibility. Such a strategy is particularly
  95. appropriate for text editing. It manifests itself in the existence of an edit tool package providing an extensible
  96. set of powerful editing commands. Nevertheless, several built-in commands are interpreted directly by text
  97. frames. They include positionning the text within its viewer, placing the caret, inserting a typed character,
  98. selecting a part of text, deleting a selected part of text, copying a selected part of text, copying attributes and,
  99. most importantly, executing an arbitrary command which is specified by its name. We should point out
  100. that all of these built-in commands are applicable in particular to menu-bars (which, in fact, are ordinary
  101. text frames featuring an inverted background color).
  102. Mouse Commands
  103. Text positionning. In order to reposition a text within a viewer, move the mouse into the viewer's
  104. scrolling-zone. This is a vertical bar along the left borderline of about 0.5 cm width. You can scroll forward by
  105. pressing the left mouse key, moving the mouse, and releasing the key when the text line that you want to
  106. become the top line is underlined. Notice that every text viewer shows a small crossbeam indicating the
  107. current position of the displayed section within the entire text. You can position a text directly by clicking the
  108. middle mouse key at the location where you want the crossbeam to be. If you wish the beginning of the text
  109. to be displayed, you can alternatively simply click the right mouse key anywhere within the scroll-bar.
  110. Placing the caret. If you want to place the caret, move the mouse to the desired text, press the left mouse
  111. button and, while keeping it down, move the caret to the desired position. Any subsequently typed
  112. characters are then inserted at this position.
  113.  As a side remark notice that German Umlaute are entered by pressing the following combinations of keys:
  114. ctrl a for 
  115. , ctrl shift a for 
  116. , ctrl o for 
  117. , ctrl shift o for 
  118. , ctrl u for 
  119. , and ctrl shift U for 
  120.         A    O    U
  121.     -    a    o    u
  122.     shift    A    O    U
  123.     ctrl    
  124.     shift ctrl    
  125. Selecting text. You can select any contiguous stretch of text by moving the mouse to the desired beginning,
  126. pressing the right mouse button and, while holding it down, dragging the selection to the end. If you click
  127. twice at the beginning, the selection is automatically extended to the origin of that text line. If a piece of text
  128. is too large to be selectable within a single viewer, use Edit.Copy to open an adjacent second viewer. Then
  129. select the beginning of the stretch of text in the upper viewer and its end in the lower viewer separately.
  130. Note that a separate selection may be active for each displayed text section, including headers of viewers. If
  131. several selections exist simultaneously on the display, commands normally refer to the most recent one or
  132. to the most recent ones.
  133. There are the following interesting interclick-variants of caret placing and text selection that combine these
  134. marking operations effectively with text editing. Remember the general rule saying that any
  135. mouse-controlled operation that is currently under execution can be nullified by interclicking all remaining
  136. mouse-keys.
  137. Copying text. If you interclick the middle mouse button while you are placing the caret, the most recent
  138. selection is automatically copied to the caret's position as soon as you release the left button. This feature is
  139. particularly convenient for copying a specific template to several different places. Alternatively, if the caret is
  140. already set and you click the middle mouse key while you are selecting a piece of text, the selected text is
  141. copied to the caret's position when you release the select-button. This option is most conveniently used in
  142. order to copy a given string to various places. In order to neutralize (undo) any "interclick", simply click the
  143. remaining third button while still holding down the primary key.
  144. Copying attributes. If you interclick the right mouse button while you are placing the caret, the character
  145. attributes (font, color, vertical offset) of the character by the caret is automatically applied to the most recent
  146. selection as soon as you release the left button.
  147. Deleting text. If you click the left mouse-button while selecting a text, the selected text is eventually deleted.
  148. Here also, the interclick can be undone by an additional interclick of the middle mouse-key. 
  149. Notice that the above described editing operations are applicable to a header of a viewer only restrictedly. A
  150. header cannot be changed. Nor can the caret be placed in a header. Further notice that the copy variant and
  151. the delete variant of the select command apply also in the case of large selections involving split viewers. 
  152. Activating a command. Activating a named command from within a text viewer is generic and therefore the
  153. most general built-in operation. In order to do it simply point to the command's name and click the middle
  154. mouse key. Sometimes (e.g. in a test phase) it is important that the newest version of the module providing
  155. the desired command is loaded before the command is actually executed. In order to force this, simply
  156. interclick the left key while you are pressing the middle mouse key and pointing to the command's name.
  157. If command execution fails, the system falls into a trap. There is no interactive debugger currently available
  158. under Oberon. However, a trap handler is automatically called whenever a trap has occurred. It displays the
  159. state of the interrupted process, including the stack of procedure activations. It also relates the location of
  160. trap to a position in the source program text. In order to find the failing statement simply display the source
  161. program and mark its viewer. Then select the position number in the trap viewer and invoke Edit.Locate. 
  162. The following table summarizes the basic meanings of the three mouse-keys: The left key is the point-key.
  163. It is used to focus a certain location, i.e. to place the caret. The middle key is the execute-key. Pressing and
  164. releasing it causes the appropriate command interpreter to be called. The right key is the select-key. It is
  165. used to select objects within a viewer.
  166. Summary of mouse commands
  167.     primary button    left    middle    right
  168. -----------------------------------------------------------------
  169.     secondary button
  170.     none    set caret    execute    select
  171.     left    -    free and execute    delete
  172.     middle    copy selection    -    copy this selection
  173.     right    copy attributes    -    -
  174. Text viewers display text in a standard line-oriented way. In particular, they do not support any non-trivial
  175. formatting, such as automatic line-breaking or right-justifying paragraphs, for example. Font variation,
  176. color specification, and vertical offset, are however possible. We recommend the following fonts to be used
  177. in connection with text viewers: Syntax10.Scn.Fnt (default font), Syntax10i.Scn.Fnt (italics variant),
  178. Syntax10b.Scn.Fnt (bold face variant), and Courier8.Scn.Fnt (non-proportional font).
  179. According to Oberon's basic scheme, additional functionality is provided by the text edit tool package. It
  180. contains the following commands.
  181. Edit Commands
  182. Edit.Open
  183. opens a viewer in the user track displaying the specified text. The text is alternatively specified by a
  184. parameter on the command line or, if a "^"-symbol follows the command name, by the most recent
  185. selection of a name. If none exists, a default name is taken. In order to override automatic allocation, place
  186. the pointer anywhere on the screen.
  187. Edit.Show M.X
  188. opens a viewer in the user track displaying the specified object X of module M. If the implementation of M is
  189. available, the implementation of X is shown, otherwise X's definition is displayed.
  190. Edit.Store
  191. writes the text in the marked viewer to the file with the name defined by the parameter, or, if called from the
  192. menu line of a text viewer, writes the displayed text to the file with the name of the viewer.
  193. Edit.Recall
  194. inserts the most recently deleted piece of text at the position of the caret.
  195. Edit.CopyFont
  196. transfers the font from the marked location to the most recent text selection.
  197. Edit.ChangeFont
  198. applies the font specified by the parameter to the most recent text selection.
  199. Edit.ChangeColor
  200. applies the color specified by the parameter to the most recent text selection.
  201. Edit.ChangeOffset
  202. applies the vertical offset specified by the parameter to the most recent text selection.
  203. Edit.Search
  204. searches a pattern in the marked text. The pattern is defined by the most recent text selection. If none exists,
  205. the previous pattern is used. Searching is started at the position of the caret. If none exists in the marked
  206. text, searching starts at the beginning. The initial value of the pattern is the space character.
  207. Edit.Locate
  208. positions the text in the marked viewer according to the position-number indicated by the most recent text
  209. selection. Leading non-numerical items in the text selection are ignored.
  210. Edit.Print ServerName ["%"] { (TextFileName | "*") ["/" NofCopies] }
  211. sends all texts specified by the parameter list to the print server whose name is taken from the first entry in
  212. the parameter list. Names in the parameter list refer to text files, the symbol * to the text in the marked
  213. viewer. The symbol % specifies the vanilla-print option. If active, the texts are printed in a single
  214. monospaced small Font (Gacha10l). This option is typically used for printing source program listings.
  215. NofCopies optionally specifies the desired number of copies. It must be a single-digit number. This
  216. command assumes that the correct user identification has previously been installed (by calling
  217. System.SetUser).
  218. The System Tool Package
  219. This package features system related commands. Among them are procedures to display tools in the form
  220. of viewers, to close viewers and tracks, to define and display all kinds of system oriented parameters, and to
  221. provide basic utilities for the manipulation of named files. In addition, the system tool package contains a
  222. trap handler that is implicitly called after a trap has occured. It displays the current state of the system stack.
  223. System.Open
  224. opens a viewer in the system track displaying the specified tool. The tool is alternatively specified by a
  225. parameter on the command line or, in the case of a "^" following the command name, by the most recent
  226. selection of a name. If none exists, a default name is taken..
  227. System.OpenLog
  228. opens a viewer in the system track displaying the system-wide log. Notice that the log is updated regardless
  229. of its visibility. Therefore, the log always shows the complete history of the current session.
  230. System.Copy
  231. opens a copy of the original viewer displaying the same instance of contents.
  232. System.Grow
  233. lets the viewer grow to the size of a whole track or, if applied to a viewer already filling a track, to the size of
  234. the whole display. Note that the original constellation will be reestablished when the grown viewer is later
  235. removed.
  236. System.Close
  237. removes the marked viewer from the display, or, if called from the menu line of a text viewer, removes the
  238. own viewer.
  239. System.CloseTrack
  240. closes the marked track, i.e. removes all viewers in this track.
  241. System.Recall
  242. reopens the most-recently (perhaps erronously) closed viewer..
  243. System.Time
  244. displays the current date and time. If date and time parameters dd.mm.yy hh.mm.ss (day, month, year and
  245. hour, minute, second) immediately follow the command name, System.Time first sets date and time
  246. accordingly.
  247. System.Watch
  248. displays the amount of currently used disk space and memory resources.
  249. System.Collect
  250. initiates a subsequent garbage collection.
  251. System.Free
  252. unloads every module specified by the parameter list. If a module name is immediately followed by *,
  253. imported modules are also unloaded.
  254. System.ShowModules
  255. displays a map of all currently loaded modules.
  256. System.ShowCommands ModName
  257. displays a list of all commands exported by this module.
  258. System.State ModName
  259. displays the global data of the specified module.
  260. System.SetUser
  261. accepts the user's identification in the form UserName "/" Password without echoing it on the display.
  262. UserName is up to eight characters long (initials in most cases). The password is an arbitrary string.
  263. System.Directory
  264. displays the selection of all disk files whose name match the template specified by the parameter. The
  265. parameter is a string and may contain the symbol "*" as a wildcard. If option "d" is specified ("/d"
  266. immediately following the parameter) additional information about file sizes and dates is displayed. In the
  267. case of a "^" following the command name the parameter is taken from the current selection.
  268. System.CopyFiles
  269. processes a parameter list of pairs A => B. Copies each file A to B. In the case of a "^" following the command
  270. name the parameter is taken from the current selection.
  271. System.RenameFiles
  272. processes a parameter list of pairs A => B. Renames each file A to B. In the case of a "^" following the
  273. command name the parameter is taken from the current selection.
  274. System.DeleteFiles
  275. deletes each file specified by the parameter list. In the case of a "^" following the command name the
  276. parameter (a single file name) is taken from the current selection.
  277. System.SetFont
  278. applies the font specified by the parameter to subsequently typed characters.
  279. System.SetColor
  280. applies the color specified by the parameter to subsequently typed characters.
  281. System.SetOffset
  282. applies the vertical offset specified by the parameter to subsequently typed characters.
  283. The Compiler Tool Package
  284. This package contains the Oberon compiler. The result of compilations is shown in the log viewer. Possible
  285. errors are listed in the log viewer together with their position in the source text. In order to locate the error
  286. within the source text, use Edit.Locate in the log viewer's title menu. The compiler tool exports a single
  287. command:
  288. Compiler.Compile
  289. compiles all texts specified by the parameter list. Names in the parameter list refer to text files, the symbol *
  290. to the text in the marked viewer. In the case of a "^" following the command name the parameter list is
  291. taken from the current selection. The following options are available: "/x" (index check off), "/v" (check
  292. integer overflow), "t" (type guards off), "/s" (allow change of symbol file), and "/d" (provide debugging
  293. information). 
  294. The Miscellaneous Tool Package
  295. This package provides utilities to convert files, determine statistical data, and demonstrate system behavior.
  296. Miscellaneous.BootLoad FileName
  297. downloads the named bootfile to boot sectors on disk.
  298. Miscellaneous.ConvertBlanks
  299. converts all text files specified by the parameter list by replacing pairs of leading spaces by tab characters. "^"
  300. following the command name refers to the current selection (a single file name).
  301. Miscellaneous.ConvertTabs
  302. converts all text files specified by the parameter list by replacing leading tab characters by pairs of spaces. "^"
  303. following the command name refers to the current selection (a single file name).
  304. Miscellaneous.Cleanup
  305. converts all text files specified by the parameter list into ordinary Ascii files i.e. deletes formatting
  306. information and removes non-printable characters. "^" following the command name refers to the current
  307. selection (a single file name).
  308. Miscellaneous.CountLines
  309. counts the lines of all text files specified by the parameter list. "^" following the command name refers to
  310. the current selection (a single file name).
  311. Miscellaneous.GetObjSize
  312. extracts code size and data size from all object files specified by the parameter list. "^" following the
  313. command name refers to the current selection (a single file name).
  314. Miscellaneous.Snapshot
  315. takes a snapshot of the current state of the screen display and stores it in the two files specified in the
  316. parameter list. The first file contains the lower half and the second file the upper half of the display.
  317. Miscellaneous.Trap
  318. forces a trap, thereby demonstrating the trap display mechanism.
  319.